import axios from 'axios'
const request = axios.create({
  timeout: 5000,
})

//请求拦截器
request.interceptors.request.use((config) => {
  //config配置对象有headers属性，常给服务端携带公共参数
  return config
})

//响应拦截器
request.interceptors.response.use(
  (response) => {
    return response
  },
  (error) => {
    console.log(error)
  },
)
export default request
